package yu.code.yurpc.loadbalancer;

import yu.code.yurpc.spi.MySpiLoader;

/**
 * 负载均衡工厂
 */
public class LoadBalancerFactory {
    static {
        MySpiLoader.load(LoadBalancer.class);
    }

    /**
     * 默认负载均衡器
     */
    private static final LoadBalancer DEFAULT_LOAD_BALANCER_NAME = new RandomLoadBalancer();

    public static LoadBalancer getInstance(String loadBalancerName) {
        return MySpiLoader.getInstance(loadBalancerName, LoadBalancer.class);
    }
}
